package com.dsbj.mp.icardservice.service.companybus;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsbj.mp.icardservice.entity.companybus.Passenger;
import com.dsbj.mp.icardservice.mapper.companybus.PassengerMapper;
import com.dsbj.mp.icardservice.utils.strprocess.StrUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * <p>
 * 乘客记录表 服务实现类
 * </p>
 *
 * @author cjw
 * @since 2020-02-25
 */
@Service
@Transactional
public class PassengerService extends ServiceImpl<PassengerMapper, Passenger> {
	
	@Resource
	private PassengerMapper passengerMapper;
	
	
	
	/**
	 * 分页获取乘客信息。
	 * @param 
	 * @return 
	 * @author cjw 2020-02-25
	 */
	public Page<Passenger> getPassengerByPage(String idcardno, int pageNum, int pageSize){
		Page<Passenger> page=new Page<Passenger>().setSize(pageSize).setCurrent(pageNum);
		passengerMapper.selectByIdcardno(page, idcardno);
		return page;
	}
	
	/**
	 * 获取员工最新的乘车记录。
	 * @param
	 * @return
	 * @author cjw 2020-02-26
	 */
	public Passenger getLatestPassenger(String idcardno){
		Passenger passenger=passengerMapper.selectLatestByIdcardno(idcardno);
		return passenger;
	}
	
	
	
	
}
